<div id="actionbar" class="fn-clear">
    <div class="fn-left">
        <button class="button bar" url="{:url('card/winCoupon',['card_id' => $card_id])}" msg="您确认要关联已选优惠券吗？"><i class="iconfont icon-lianjie"></i>确认关联优惠券</button> 
    </div>
    <div class="fn-right">
    <form id="form" action="{:url('card/winCoupon')}" method="get">
        <input type="hidden" name="card_id" value="{$card_id}" />
        <input placeholder="请输入用户优惠券名称" class="input w200" type="text" name="keyword" value="{$keyword}" /><input type="submit" value="搜索" class="button button-blue" />
    </form>
    </div>
</div>
<table class="table table-border">
    <thead>
        <tr>
            <th class="w40 fn-tac"><input type="checkbox" onclick="CheckAll(this)"></th>
            <th>优惠券</th>
            <th class="w60 fn-tar">购买价</th>
            <th class="w100 fn-tac">￥额度</th>
            <th class="w80 fn-tac">￥满用</th>
            <th class="w100 fn-tac">抵扣/折扣</th>
            <th class="w200 fn-tac">有效期</th>
        </tr>
    </thead>
    <tbody>
        {foreach $lists as $vo}
        <tr>
            <td class="fn-tac"><input name="ids[]" type="checkbox" value="{$vo.id}"></td>
            <td>
                <i class="iconfont icon-discount"></i><span class="selectID fn-cp fn-fb" url="{:url('coupon/review',['id'=>$vo.id])}">{$vo.name}</span><br />
                <span class="selectID fn-cp" url="{:url('store/review',['id'=>$vo.store.id])}"><i class="iconfont icon-store_icon"></i>{$vo.store.name}</span><br />
                <span class="gray"><i class="iconfont icon-wodedingdan2"></i>{$vo.tips}</span>
            </td>
            <td class="fn-tar">{$vo.pay_price}</td>
            <td class="fn-tar">{$vo.size}元</td>
            <td class="fn-tar">{$vo.howmuch}元</td>
            <td class="fn-tar">{if $vo.types}<span class="badge bg-blue">{$vo.discount}折</span>{else}<span class="badge bg-green">{$vo.price}元</span>{/if}</td>
            <td class="fn-tac">{$vo.starttime|date="Y-m-d"} 至 {$vo.endtime|date="Y-m-d"}</td>
        </tr>
        {/foreach}
    </tbody>
</table>
{$lists|raw}
<script type="text/javascript">
Do('base','layer',function(){
    $(".bar").click(function() {
        var url = $(this).attr('url');
        var msg = $(this).attr('msg');
        tools_submit({action:url,msg:msg})
    })
    $(".selectID").win();
})
</script>